package com.nulstudio.sppm.Service;

import com.nulstudio.sppm.Dao.SupplierMapper;
import com.nulstudio.sppm.Entities.SupplierInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierService {
    @Autowired
    private SupplierMapper supplierMapper;

    public List<SupplierInfo> getAllSuppliers() {
        return supplierMapper.getAllSuppliers();
    }

    public int addSupplier(SupplierInfo supplierInfo) {
        return supplierMapper.addSupplier(supplierInfo);
    }

    public int modifySupplier(SupplierInfo request) {
        return supplierMapper.modifySupplier(request);
    }

    public int getIdByInfo(SupplierInfo request) {
        return supplierMapper.getIdByInfo(request);
    }

    public int getLastId() {
        return supplierMapper.getLastId();
    }
    public int deleteSupplier(String id){return supplierMapper.deleteSupplier(Integer.parseInt(id));}
}
